<?php



/**
 * This class defines the structure of the 'army_defs' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.nawragon.map
 */
class ArmyDefsTableMap extends TableMap
{

    /**
     * The (dot-path) name of this class
     */
    const CLASS_NAME = 'nawragon.map.ArmyDefsTableMap';

    /**
     * Initialize the table attributes, columns and validators
     * Relations are not initialized by this method since they are lazy loaded
     *
     * @return void
     * @throws PropelException
     */
    public function initialize()
    {
        // attributes
        $this->setName('army_defs');
        $this->setPhpName('ArmyDefs');
        $this->setClassname('ArmyDefs');
        $this->setPackage('nawragon');
        $this->setUseIdGenerator(true);
        // columns
        $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);
        $this->addColumn('code', 'Code', 'VARCHAR', true, 4, null);
        $this->addColumn('name', 'Name', 'VARCHAR', true, 20, null);
        $this->addColumn('attack_min', 'AttackMin', 'INTEGER', true, null, null);
        $this->addColumn('attack_max', 'AttackMax', 'INTEGER', true, null, null);
        $this->addColumn('defense', 'Defense', 'INTEGER', true, null, null);
        $this->addColumn('cost', 'Cost', 'DECIMAL', true, 11, null);
        $this->addColumn('description', 'Description', 'LONGVARCHAR', false, null, null);
        $this->addColumn('active', 'Active', 'TINYINT', true, null, 1);
        $this->addColumn('created', 'Created', 'TIMESTAMP', true, null, 'CURRENT_TIMESTAMP');
        $this->addColumn('last_modified', 'LastModified', 'TIMESTAMP', false, null, null);
        // validators
    } // initialize()

    /**
     * Build the RelationMap objects for this table relationships
     */
    public function buildRelations()
    {
        $this->addRelation('Army', 'Army', RelationMap::ONE_TO_MANY, array('id' => 'army_def_id', ), 'RESTRICT', 'RESTRICT', 'Armys');
    } // buildRelations()

} // ArmyDefsTableMap
